int QuickSort(int *nums,int left,int right,int k)
{
    if(left>=right) return nums[left];
    int i=left-1,j=right+1,x=nums[left+right>>1];
    while(i<j)
    {
        do i++; while(nums[i]<x);
        do j--; while(nums[j]>x);
        if(i<j)
        {
            int temp=nums[i];
            nums[i]=nums[j];
            nums[j]=temp;
        }
    }
    int SL=j-left+1;
    if(SL>=k) return QuickSort(nums,left,j,k);
    else return QuickSort(nums,j+1,right,k-SL);
}

int findKthLargest(int* nums, int numsSize, int k) {
    return  QuickSort(nums,0,numsSize-1,numsSize-k+1);
}